package com.ted.testpluginv3

import android.app.Activity
import android.os.Bundle
import android.widget.Toast
import kotlinx.android.synthetic.main.activity_main.*
import org.jetbrains.anko.toast
import test.ted.com.androidplugin2.HostManager

class MainActivity : Activity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        var hostManager = HostManager()
        hostManager.init(this, "gapshuai from host 2333333333333")
        var testPlugin = hostManager.getTestPlugin(this)
        if (testPlugin != null) {
            sample_text.text = "From Jni: ${testPlugin.tipsFromNative}\nFrom java: ${testPlugin.getTipsFromJava(this)}"
        } else {
            toast("plugin is null")
        }
    }
}
